<!--
/**
 * This file is part of the smilText parser implemented in JavaScript,
 *
 * Copyright (C) 2003-2009 Stichting CWI, 
 * Science Park 123, 1098 XG Amsterdam, The Netherlands.
 *
 * smilText parser in JavaScript is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * smilText parser in JavaScript is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with smilText parser in JavaScript; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

/**
 @version 1.0
 @author <a href="mailto:rlaiola@cwi.nl">Rodrigo Laiola Guimaraes</a>
*/
-->

<HTML>
<HEAD>
<script type="text/javascript" src="../src/scripts/jsoner.commons.js"></script>
<script type="text/javascript" src="../src/scripts/com.iskitz.ajile.1.2.1.js"></script>
<script type="text/javascript" src="../src/scripts/cwi.adt.js"></script>
<script type="text/javascript" src="../src/scripts/cwi.util.js"></script>
<script type="text/javascript" src="../src/scripts/cwi.smilText.Time.js"></script>
<script type="text/javascript" src="../src/scripts/cwi.smilText.js"></script>
</HEAD>
<BODY>

<H2>smilText Examples: BasicText Module</H2>

<!-- import smilText data onload event -->
<H3>Example 1: Hello World!</H3>
<H4 style='color:red'>Note: Safari cannot import an xml file (Problem reported in many foruns)</H4>
<DIV id="region1">
<script>
var doc1 = cwi.smilText.Parser.parseFile('examples/example1.xml', 'region1');
doc1.play();
</script>
</DIV>
<A HREF="javascript:doc1.play()">Play</A>
<A HREF="javascript:doc1.pause()">Pause</A>
<A HREF="javascript:doc1.stop()">Stop</A>
<br/>
<A HREF="examples/example1.xml">view smilText file</A>

<!-- import smilText data onload event -->
<H3>Example 2: Example 1 with duration = 10s</H3>
<DIV id="region2">
<script>
var doc2 = cwi.smilText.Parser.parseFile('examples/example2.xml', 'region2');
doc2.play();
</script>
</DIV>
<A HREF="javascript:doc2.play()">Play</A>
<A HREF="javascript:doc2.pause()">Pause</A>
<A HREF="javascript:doc2.stop()">Stop</A>
<br/>
<A HREF="examples/example2.xml">view smilText file</A>

<!-- import smilText data onload event -->
<H3>Example 3: Example 2 with a line break</H3>
<DIV id="region3">
<script>
var doc3 = cwi.smilText.Parser.parseFile('examples/example3.xml', 'region3');
doc3.play();
</script>
</DIV>
<A HREF="javascript:doc3.play()">Play</A>
<A HREF="javascript:doc3.pause()">Pause</A>
<A HREF="javascript:doc3.stop()">Stop</A>
<br/>
<A HREF="examples/example3.xml">view smilText file</A>

<!-- import smilText data onload event -->
<H3>Example 4: Example 3 with TEV and CLEAR tags</H3>
<DIV id="region4">
<script>
var doc4 = cwi.smilText.Parser.parseFile('examples/example4.xml', 'region4');
doc4.play();
</script>
</DIV>
<A HREF="javascript:doc4.play()">Play</A>
<A HREF="javascript:doc4.pause()">Pause</A>
<A HREF="javascript:doc4.stop()">Stop</A>
<br/>
<A HREF="examples/example4.xml">view smilText file</A>

<!-- import smilText data onload event -->
<H3>Example 5: Example 4 without explicit duration</H3>
<DIV id="region5">
<script>
var doc5 = cwi.smilText.Parser.parseFile('examples/example5.xml', 'region5');
doc5.play();
</script>
</DIV>
<A HREF="javascript:doc5.play()">Play</A>
<A HREF="javascript:doc5.pause()">Pause</A>
<A HREF="javascript:doc5.stop()">Stop</A>
<br/>
<A HREF="examples/example5.xml">view smilText file</A>

<!-- import smilText data onload event -->
<H3>Example 6: Example 5 with explicit duration = 3s</H3>
<DIV id="region6">
<script>
var doc6 = cwi.smilText.Parser.parseFile('examples/example6.xml', 'region6');
doc6.play();
</script>
</DIV>
<A HREF="javascript:doc6.play()">Play</A>
<A HREF="javascript:doc6.pause()">Pause</A>
<A HREF="javascript:doc6.stop()">Stop</A>
<br/>
<A HREF="examples/example6.xml">view smilText file</A>

<!-- smilText tag inside the html file -->
<H3>Example 7: smilText tag inside the html file</H3>
<H4 style='color:red'>Note: IE cannot read smilText tags inside the html file</H4>
<DIV id="region7">
	<smilText id="text1" dur="5s" textWrapOption="wrap">
	Hallo!
	<clear begin="3s"></clear>
	Hoe gaat het?
	<tev next="2s"></tev>
	Doei!
	</smiltext>
</DIV>
<A HREF="javascript:docs[0].play()">Play</A>
<A HREF="javascript:docs[0].pause()">Pause</A>
<A HREF="javascript:docs[0].stop()">Stop</A>
<br/>

<!-- smilText tag inside the html file -->
<H3>Example 8: Example 7 with textWrapOption = wrap</H3>
<DIV id="region8" STYLE="background-color:yellow;width:50;height:50">
	<smilText id="test2" dur="5s" textWrapOption="wrap">
	Hallo!
	<clear begin="3s"></clear>
	Hoe gaat het?
	<tev next="2s"></tev>
	Doei!
	</smiltext>
</DIV>
<A HREF="javascript:docs[1].play()">Play</A>
<A HREF="javascript:docs[1].pause()">Pause</A>
<A HREF="javascript:docs[1].stop()">Stop</A>
<br/>

<script>
var docs = cwi.smilText.Parser.parseHTML();
for (i = 0; i < docs.length; i++) {
	docs[i].play();
}
</script>

</BODY>
</HTML>